import { instance as request } from '../request'

/**
 * 创建项目
 * @param data
 * @returns
 */
export const createProjectApi = (data: createProjectItf): PromiseRes =>
  request.post('/project/create', data)

/**
 * 更新项目信息
 * @param data
 * @returns
 */
export const updatreProjectApi = (data: updateProjectItf): PromiseRes =>
  request.put('/project/update', data)

/**
 * 删除项目
 * @param id  项目id
 * @returns
 */
export const deleteProjectApi = (id: string): PromiseRes =>
  request.delete(`/project/delete/${id}`)

/**
 * 分页获取项目列表
 * @param page  页码
 * @param pageSize  分页大小
 * @returns
 */
export const getProjectPageListAPi = (params: {
  page: number
  pageSize: number
}): PromiseRes<getProjectPageListResultItf> =>
  request.get(`/project/projectList`, { params })
